Registers a tool with the ToolTip control
#include <GuiToolTip.au3>
_GUIToolTip_AddTool ( $hTool, $hWnd, $sText [, $iID = 0 [, $iLeft = 0 [, $iTop = 0 [, $iRight = 0 [, $iBottom = 0 [, $iFlags = Default [, $iParam = 0]]]]]]] )
| $hTool | Handle to the ToolTip control (returned by _GUIToolTip_Create.) |
| $hWnd | Handle of the window that contains the tool, or 0 |
| $sText | Text for the ToolTip control. See remark. |
| $iID | [optional] Identifier of the tool, or Window handle of the control the tool is to be assigned to |
| $iLeft | [optional] X coordinate of the upper left corner of the rectangle |
| $iTop | [optional] Y coordinate of the upper left corner of the rectangle |
| $iRight | [optional] X coordinate of the lower right corner of the rectangle |
| $iBottom | [optional] Y coordinate of the lower right corner of the rectangle |
| $iFlags | [optional] Flags that control the ToolTip display: $TTF_IDISHWND - Indicates that $iID is a window or control handle, instead of the ID of the tool $TTF_CENTERTIP - Centers the tooltip below the control specified by $iID $TTF_RTLREADING - Indicates that text will be displayed in the opposite direction of the parent window (see remarks) $TTF_SUBCLASS - Indicates that the control should subclass the tool's window $TTF_TRACK - Positions the tooltip window next to the tool to which it corresponds $TTF_ABSOLUTE - Positions the window at the same coordinates provided by TTM_TRACKPOSITION. (see remarks) $TTF_TRANSPARENT- Causes the control to forward mouse messages to the parent window $TTF_PARSELINKS - Indicates that links in the control text should be displayed as links Default = BitOr($TTF_SUBCLASS, $TTF_IDISHWND) |
| $iParam | [optional] Application-defined value that is associated with the tool |
| Success: | True. |
| Failure: | False. |
#include <GUIConstantsEx.au3>
#include <GUIToolTip.au3>
Example()
Func Example()
Local $hGUI = GUICreate(StringTrimRight(@ScriptName, 4), 350, 200)
Local $iButton = GUICtrlCreateButton("This is a button", 30, 32, 130, 28)
Local $hButton = GUICtrlGetHandle($iButton)
; create a tooltip control using default settings
Local $hToolTip = _GUIToolTip_Create(0)
; add a tool to the tooltip control
_GUIToolTip_AddTool($hToolTip, 0, "This is a ToolTip", $hButton)
GUISetState()
While 1
If GUIGetMsg() = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
; Destroy the tooltip control
_GUIToolTip_Destroy($hToolTip)
GUIDelete($hGUI)
EndFunc ;==>Example